<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style/admin.css" />
<link rel="stylesheet" type="text/css" href="style/global.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script src="js/artDialog/jquery.artDialog.js?skin=chrome"></script>
<script src="js/artDialog/plugins/iframeTools.source.js"></script>
<script src="js/comm.js" type="text/javascript"></script>
<script src="js/jquery.tabs.js" type="text/javascript"></script>
<script src="js/ocx.js" type="text/javascript"></script>
<title>无标题文档</title>
<script>
$(function () {
	$.tabs({
		selector:"#tb1",
		event:'click',
		selectedClass:'cur',
		callback: function(panels, tabs, index) {
			if (4 == index) {
				JYCsm.showBuyTip();
			}
		}
	});
	$.tabs({
		selector:"#tb2",
		event:'click',
		selectedClass:'cur'
	});
});

</script>
</head>

<body>

<script>
/*var JYTele = parent.JYTopTele;
JYTele.onHangUp = function () {
	$('.call a').text('呼叫');
};
JYTele.onCallOut = function () {
	$('.call a').html('<font color="red">挂断</font>');
};*/

$(function () {	
	$('.call a').click(function () {
		if (!JYTele.isCalling) {
			JYTele.isCalling = true;
			// 获取控件中的电话号码
			JYTele.callOut('13058189309');
		} else {
			JYTele.hangUp();
			$('.call a').text('呼叫');
		}
	});
	$('.msg a').click(function () {alert(JYTele.getRecordFileName());});

	// 回访保存
	$('#save-result').click(function () {
		var dlg_content = $('#visit-result-dlg').html();
		window.top.art.dialog({
			id: 'save-result-dlg',
			title: '回访小结保存', 
			width: 500,
			padding: 10,
			content: dlg_content});
	});

	// 回访下一个
	$('#next-entry').click(function () {
		window.location.href="?c=visitzy&a=entry&p=<?php echo $next?>";
	});
});
</script>

	<div id="wrap">
    	<div class="m_head">
        	<div class="m_positin">题库管理</div>
            <div class="m_record">您今日已回访 <span class="orange"><b>98</b></span> 位客户，本月已回访 <span class="orange"><b>1278</b></span> 位客户</div>
            <div class="clear"></div>
        </div>
        <div class="p_content">
        	<div class="p_datas"><div class="p_data">
            	<div class="p_top">
                	<div class="left">
                    	<h2>姓名：<span class="red"><?php echo $patient['TRUE_NAME']?></span>性别：<span class="red"><?php echo $patient['SEX']?></span>年龄：<span class="red"><?php echo ATools::getAge($patient['BIRTH'])?></span></h2>
                        <table class="tabClient" border="0" width="100%">
                          <tr><th height="25" width="20%">身份证号：</th><td width="40%"><?php echo $patient['CARD']?></td><th width="20%">出生日期：</th><td width="20%"><?php echo $patient['BIRTH']?></td></tr>
                          <tr><th height="25">职<span class="spacing_one"></span>业：</th><td><?php echo $patient['JOB']?></td><th>籍<span class="spacing_one"></span>贯：</th><td><?php echo $patient['BIRTHPLACE']?></td></tr>
                          <tr><th height="25">住<span class="spacing_one"></span>址：</th><td colspan="3"><?php echo $patient['DWADDR']?></td></tr>
                          <tr><th height="25">联<span class="spacing_two"></span>系<span class="spacing_two"></span>人：</th><td colspan="3"><?php echo $patient['LXR_NAME']?> / <?php echo $patient['RELATION']?></td></tr>
                        </table>
                        <div class="p_message">
                          <img src="images/bg_p_left_message.jpg" height="36" width="375" />
                          <div class="pm_content">
                              <div class="number"><input class="p_checkbox" name="" type="checkbox" value="" /> 外地 
                                <select class="p_select" name="teleNo" id="teleNo">
                                <?php if ($patient['PHONE']) {?>
                                    <option value="<?php echo $patient['PHONE']?>"><?php echo $patient['PHONE']?></option>
                                <?php }
                                 if ($patient['LXR_PHONE'] and $patient['LXR_PHONE'] != $patient['PHONE']) {?>
                                    <option value="<?php echo $patient['LXR_PHONE']?>"><?php echo $patient['LXR_PHONE']?>(联)</option>
                                <?php }
                                 if (!$patient['PHONE'] and !$patient['LXR_PHONE']) {?>
                                    <option value="-1">无联系方式</option>
                                <?php }?>
                                </select>
                              </div>
                              <div class="call"><a href="javascript:void(0);">呼叫</a></div>
                              <div class="msg"><a href="javascript:void(0);">短信</a></div>
                              <div class="clear"></div>
                           </div>
                    	</div>
                    </div>
                    <div class="right">
                    	<h2>客户最新住院情况</h2>
                        <dl class="tabs" id="tb1">
                            <dt>
                                <a class="cur">基本情况</a>
                                <a>出院医嘱</a>
                                <a>出院诊断</a>
                                <a>手术信息</a>
                                <a>健康处方</a>
                            </dt>
                            <div class="clear"></div>
                            <dd>
                                <table class="tabCase" width="0" border="0">
                                  <tr><td height="26" width="35%"><b>住院号：</b><?php echo $zhuyuan['ZY_NO']?></td><td width="35%"><b>住院次数：</b><?php echo $zhuyuan['ZY_TIMES']?></td></tr>
                                  <tr><td height="26"><b>入院时间：</b><?php echo date('Y-m-d',strtotime($zhuyuan['RY_DATE']))?></td><td><b>出院时间：</b><?php echo date('Y-m-d', strtotime($zhuyuan['CY_DATE']))?></td></tr>
                                  <tr><td height="26"><b>住院天数：</b><?php echo $zhuyuan['ZY_DAYS']?></td><td><b>已出院：</b><span class="red"><?php echo ATools::getAge($zhuyuan['CY_DATE'], '年')?></span></td></tr>
                                  <tr><td height="26"><b>科室：</b><?php echo $zhuyuan['CY_DEP']?></td><td><b>复诊日期：</b>2012-03-14</td></tr>
                                  <tr><td height="26"><b>管床医生：</b><?php echo $zhuyuan['ZYDOC']?></td><td><b>责任护士：</b><?php echo $zhuyuan['ZKNURSE']?></td></tr>
                                </table>
                            </dd>
                            <dd><?php echo $zhuyuan['CY_YZ']?></dd>
                            <dd><?php echo $zhuyuan['RY_ZD']?></dd>
                            <dd>
                            	<?php if ($operation) {?>
                            	<table class="tabCase" width="0" border="0">
                                  <tr><td height="26" width="35%"><b>手术名称：</b><?php echo $operation['OP_NAME']?></td><td width="35%"><b>手术时间：</b><?php echo $operation['OP_DATE']?></td></tr>
                                  <tr><td height="26"><b>切口：</b><?php echo $operation['QIEKOU']?></td><td><b>愈合情况：</b><?php echo $operation['YUHE']?></td></tr>
                                  <tr><td height="26"><b>手术医生：</b><?php echo $operation['DOC_NAME']?></td><td><b>麻醉情况：</b><span class="red"><?php echo $operation['MAZUI']?></span></td></tr>
                                </table>
                                <?php } else {?>
                                	没有手术信息
                                <?php }?>
                            </dd>
                            <dd id="zy_jkcf"></dd>
                        </dl>
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="p_bottom">
                    <img src="images/bg_p_data_bottom_left.jpg" width="380" height="49" border="0" usemap="#Map2" class="left" />
                    <map name="Map2" id="Map2">
                       <area shape="rect" coords="1,1,76,48" href="javascript: JYCsm.showBuyTip();" />
                       <area shape="rect" coords="76,1,153,49" href="javascript: JYCsm.openFeedForm();" />
                       <area shape="rect" coords="152,-1,227,48" href="" />
                       <area shape="rect" coords="228,0,303,49" href="javascript: JYCsm.openAskForm();" />
                       <area shape="rect" coords="304,2,381,49" href="javascript: JYCsm.showBuyTip();" />
                    </map>
					<div class="right">
                    	<input id="save-result" class="btn_pOne" name="" type="button" value="" /> 
                    	<input id="next-entry" class="btn_pTwo" name="" type="button" value="" />
                    </div>
                    <div class="clear"></div>
                </div>
            </div></div>
            <dl class="p_r_tabs" id="tb2">
                <dt>
                    <a class="cur">住院信息</a>
                    <a>问卷调查</a>
                    <a>预约挂号信息</a>
                    <a>咨询记录</a>
                    <a>反馈跟踪</a>
                    <a>回访记录</a>
                </dt>
                <div class="clear"></div>
                <dd id="zy_his"></dd>
                <dd>测试2</dd>
                <dd>测试3</dd>
                <dd>测试4</dd>
                <dd>测试5</dd>
                <dd>测试6</dd>
            </dl>
        </div>
    </div>
<script type="text/javascript">
$("dl #zy_his").load("index.php?c=zy&a=history&pid=<?php echo $pid?>");
</script>


<!-- 回访结果保存对话框 -->
<div id="visit-result-dlg" style="display:none;">

<script type="text/javascript">
$(function() { 
    $('#save-btn').click(function(e) {
        JYCsm.form.ajaxPost({formSelector:'#visit-result-form', dlgSelector:'save-result-dlg'});
        return;
       var data = $('#visit-result-form').serialize(); 
       $.post($('#visit-result-form').attr('action'), data, function (rsp, status, xhr) {
           if (rsp.code == 1) {
               JYCsm.messager.succ(rsp.msg);
               JYCsm.closeWindow('save-result-dlg');
           } else {
               JYCsm.messager.error(rsp.msg);
           }
       }, 'json');
        return false;
    });

    // 在回访状态成功时 可设置回访结果
	$('#status').change(function () {
		var val = $('#status').val();
		if (val == 'A') {
			$('#result').attr('disabled', false);
		} else {
			$('#result').attr('disabled', true);
		}
	});
}); 
</script>
<div class="msgBox">
    	<h2>回访小结保存</h2>
        <div class="bc">
        	<form method="post" action="?c=visit&a=result" id="visit-result-form" name="visit-result-form">
        	<input type="hidden" name="pid" value="<?php echo $patient['PATIENT_ID']?>" />
        	<input type="hidden" name="bizcode" value="<?php echo $zhuyuan['BIZ_CODE']?>" />
        	<input type="hidden" name="sysid" value="1" />
        	<input type="hidden" name="rule" value="1" />
        	<input type="hidden" name="type" value="1" />
        	<table class="tableForm" width="100%" border="0">
              <tr><th height="35" width="100">回访结果：</th><td>
              	<select id="status" class="select" name="status">
              	<?php 
              	$visitStatus = ATools::getConfig('app.visitStatus');
              	$unvisit = array_slice($visitStatus, 0, 1);
              	array_shift($visitStatus);
              	$visitStatus = array_merge($visitStatus, $unvisit);
              	foreach ($visitStatus as $value=>$name) {
              		echo '<option value="'.$value.'">'.$name.'</option>';
              	}
              	?>
              	</select></td></tr>
               <tr id="result-row"><th height="35" width="100">回访评价：</th><td>
               <select id="result" class="select" name="result">
               <?php 
               $visitResult = ATools::getConfig('app.visitResult');
               foreach ($visitResult as $value=>$name) {
               		echo '<option value="'.$value.'">'.$name.'</option>';
               }
               ?>
               </select></td></tr>
              <tr><th style="vertical-align:top;">内容：</th><td><textarea class="textarea" name="content" cols="2" rows="10"></textarea></td></tr>
              <tr><th height="35">&nbsp;</th><td><input name="track" type="checkbox" value="1" />需要继续跟进</td></tr>
              <tr><th height="35">&nbsp;</th><td><input id="save-btn" class="btn_save" name="" type="button" value=""/></td></tr>
            </table>
            </form>
        </div>
</div>
</div>
    
</body>
</html>